<?php
class RegisterSuccess extends Module
{
	function RegisterSuccess($row)
	{
		Module::Module($row);
		
		switch(Url::get('cmd'))
		{
			case 'notify'://Thông báo kích hoạt tài khoản (nếu bật chế độ cần kích hoạt - USER_ACTIVE_ON = true )
				if(!User::is_login())
				{
					if(USER_ACTIVE_ON)
					{
						require_once 'forms/Notify.php';
						$this->add_form(new NotifyForm);
					}
					else
					{
						Url::redirect_url();
					}
				}
				else
				{
					Url::redirect_url("member-" . User::id() .".html");
				}
				
				break;
			case 'active'://Kích hoạt tài khoản
				if(!User::is_login())
				{
					if(USER_ACTIVE_ON)
					{
						require_once 'forms/Active.php';
						$this->add_form(new ActiveForm);
					}
					else
					{
						Url::redirect_url();
					}
				}
				elseif(User::is_login())
				{
					//Url::redirect('user_info',array('user_id'=>User::id(),'user_name'=>User::user_name()));
					Url::redirect_url("member-" . User::id() .".html");
				}
				
				break;
			case 'activated':
			default:
				require_once 'forms/RegisterSuccess.php';
				$this->add_form(new RegisterSuccessForm);
				break;
		}
	}
}
?>